package com.biomatch.mqtt;

import com.biomatch.context.SpringContainer;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttMessage;

public class MqttClientCallBack implements MqttCallback {
    @Override
    public void connectionLost(Throwable throwable) {
        MqttClient mqttClient = SpringContainer.getBean(MqttClient.class);
        mqttClient.reconnect();
    }

    @Override
    public void messageArrived(String s, MqttMessage mqttMessage) throws Exception {

    }

    @Override
    public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {

    }
}
